<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
	 
	<title>修改用户信息</title>   
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="Bookmark" href="/favicon.ico" >
	<link rel="Shortcut Icon" href="/favicon.ico" />
	
	<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
	<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
	<script type="text/javascript">
	 $(function(){
	 
	        //页面加载显示所有部门
		     $.getJSON("dept/list.action","",function(res){
		        for(var i=0;i<res.length;i++)
		        {
		            var check="";
		            var dd=$("#dd").val();
		            if(dd==res[i].de_id) check="selected";
		            $("#dep").append("<option value='"+res[i].de_id+"' "+check+">"+res[i].de_name+"</option>");
		        }
		     });
		     
		     
		     
		      //页面加载显示所有角色
		     $.getJSON("role/list.action","",function(res){
		         for(var i=0;i<res.length;i++)
		        {
		            var check="";
		            var rr=$("#rr").val();
		            if(rr==res[i].ro_id) check="selected";
		            $("#role").append("<option value='"+res[i].ro_id+"' "+check+">"+res[i].ro_name+"</option>");
		        }
		     });
	 });
	
	</script>
</head>
<body>
   
<article class="page-container">
	<form action="emp/mod.action" method="post" class="form form-horizontal" id="form-member-mod">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">照片：</label>
			<!-- value="${emp.ar_photo}"  -->
			<div class="formControls col-xs-8 col-sm-9"> <span class="btn-upload form-group">
				<input class="input-text upload-url" type="text" name="ar_photo" id="uploadfile" readonly value="${emp.ar_photo}" nullmsg="请添加附件！" style="width:200px">
				<a href="javascript:void();" class="btn btn-primary radius upload-btn"><i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
				<input type="file" class="input-file" >
				</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">
			<span class="c-red">*</span>用户名：</label>
			<div class="formControls col-xs-8 col-sm-9">
			    <input type="hidden" name="us_id" value="${emp.us_id}" />
			    <input type="hidden" name="a_id.ar_id" value="${emp.a_id.ar_id}" />
			    <input type="hidden" name="us_password" value="${emp.us_password}" />
			   
			     <input type="hidden" name="a_id.ar_status" value="${emp.a_id.ar_status}" />
				<input type="text" class="input-text" value="${emp.us_name}" readonly="readonly" id="username" name="us_name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">
			<span class="c-red">*</span>性别：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input name="a_id.ar_sex" value="男" type="radio" id="sex-1" ${emp.a_id.ar_sex=='男'?'checked':''}>
					<label for="sex-1">男</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="sex-2" value="女" name="a_id.ar_sex" ${emp.a_id.ar_sex=='女'?'checked':''}>
					<label for="sex-2">女</label>
				</div> 
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">
			<span class="c-red">*</span>角色：</label>
			<input type="hidden" name="" value="${emp.ro_id.ro_id}" id="rr" />
			<div class="formControls col-xs-8 col-sm-9">
				<select name="ro_id.ro_id" id="role">
			        <option value="">--请选择一个角色--</option>
			     </select>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">
			<span class="c-red">*</span>部门：</label>
			<input type="hidden" name="" value="${emp.us_depid.de_id}" id="dd" />
			<div class="formControls col-xs-8 col-sm-9">
				<select name="us_depid.de_id" id="dep">
			        <option value="">--请选择一个部门--</option>
			     </select>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>手机：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${emp.us_phone}" placeholder="" id="mobile" name="us_phone">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>身份证号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${emp.a_id.ar_idcard}" placeholder="" id="mobile" name="a_id.ar_idcard">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>邮箱：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" value="${emp.a_id.ar_email}" class="input-text" placeholder="@" name="a_id.ar_email" id="email">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>出生年月：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" value="<fmt:formatDate value='${emp.a_id.ar_birthday}' pattern='yyyy-MM-dd HH:mm:ss'/>" class="input-text" placeholder="@" name="a_id.ar_birthday" >
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>入职日期：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" value="<fmt:formatDate value='${emp.a_id.intime}' pattern='yyyy-MM-dd HH:mm:ss'/>" class="input-text" placeholder="@" name="a_id.intime">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>所在国家：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" value="${emp.a_id.ar_country }" class="input-text" placeholder="@" name="a_id.ar_country">
			</div>
		</div>
		<script src="js/area.js" type="text/javascript" ></script>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">所在省份：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
				<select id="province" class="select" size="1" name="a_id.ar_province" onchange="doProvAndCityRelation();" >
                  <option id="choosePro" value="">请选择您所在省份</option>
                </select>
				</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">所在城市：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
				<select id="citys" class="select" size="1" name="a_id.ar_city" onchange="doCityAndCountyRelation();" >
                  <option id='chooseCity' value=''>请选择您所在城市</option>
              </select>
				</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">所在区/县：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">
				<select id="county"  class="select" size="1" name="a_id.ar_district">
                  <option id='chooseCounty' value=''>请选择您所在区/县</option>
              </select>
				</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">详细地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="a_id.ar_address" cols="" rows="" class="textarea"  placeholder="" onKeyUp="$.Huitextarealength(this,100)">${emp.a_id.ar_address}</textarea>
				
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius"  type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>


<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	
});
  
  $("#form-member-mod").validate({
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
				type: 'post',
				url: "emp/mod.action" ,
				success: function(data){
					layer.msg('修改成功!',{icon:1,time:1000});
				},
                error: function(XmlHttpRequest, textStatus, errorThrown){
					layer.msg('error!',{icon:1,time:1000});
				}
			});
			var index = parent.layer.getFrameIndex(window.name);
			window.parent.location.reload();//刷新父页面
			parent.layer.close(index);
			//locaton="dept-list.jsp";
		}
	});


</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>